Skip to content

feat: provide message validation during extraction#28

Merged
ramsey merged 2 commits intomainfrom
feature/extraction-validation
Dec 16, 2021
Merged

feat: provide message validation during extraction#28
ramsey merged 2 commits intomainfrom
feature/extraction-validation

Conversation

@ramsey
Copy link
Copy Markdown
Contributor

@ramsey ramsey commented Dec 16, 2021

Description

This PR provides the --validate-messages option to the formatphp extract command. When providing this option, the CLI tool will respond with a non-zero exit code, if it encounters any errors, and it will also print all the errors to STDERR, like this:

Screen Shot 2021-12-15 at 22 41 57

Product requirements and context

How has this been tested?

PR Checklist

  • I have added tests to cover my changes.

@ramsey ramsey requested a review from a team December 16, 2021 04:46
Comment thread src/Console/Command/ExtractCommand.php
Comment thread src/Extractor/MessageExtractor.php
@ramsey
Copy link
Copy Markdown
Contributor Author

ramsey commented Dec 16, 2021

I added a few extra folks to the reviewers list here, mainly to show y'all how this will work in lieu of having sniffs for source code linting of the message formatters on the PHP side.

When we run the extraction command, if there are validation errors, this is what devs will see (and we will run this command during the pre-commit hook, so it'll block if they have errors).

It will not check for style/convention issues (i.e., key names, enforced description, etc.) in the source code.

@qlty-cloud-legacy
Copy link
Copy Markdown

Code Climate has analyzed commit 156cb0c and detected 5 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 5

The test coverage on the diff in this pull request is 100.0% (80% is the threshold).

This pull request will bring the total coverage in the repository to 96.9% (0.2% change).

View more on Code Climate.

@ramsey ramsey merged commit ef04159 into main Dec 16, 2021
@ramsey ramsey deleted the feature/extraction-validation branch December 16, 2021 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants